<?php
class Difficulty {

    public function __construct() {
        $this->SQL = MySQL::getInstance();
    }

    /*
     * getAll - get all available difficulties
     * @return array of array(id, value, name) with id as key
     */
    public function getAll() {
        $ret = $this->SQL->fquery('
            SELECT id, value, name
            FROM difficulties
            ORDER BY name'
        );
        $data = array();
        foreach($ret as $row) {
            $data[$row['id']] = $row;
        }
        return $data;
    }
}
?>
